1. Field of the Invention
This invention relates generally to the field of computer graphics and, more particularly, to a high performance graphics system which implements super-sampling.
xcex94
2. Description of the Related Art
A computer system typically relies upon its graphics system for producing visual output on the computer screen or display device. Early graphics systems were only responsible for taking what the processor produced as output and displaying that output on the screen. In essence, they acted as simple translators or interfaces. Modem graphics systems, however, incorporate graphics processors with a great deal of processing power. They now act more like coprocessors rather than simple translators. This change is due to the recent increase in both the complexity and amount of data being sent to the display device. For example, modern computer displays have many more pixels, greater color depth, and are able to display images that are more complex with higher refresh rates than earlier models. Similarly, the images displayed are now more complex and may involve advanced techniques such as anti-aliasing and texture mapping.
As a result, without considerable processing power in the graphics system, the CPU would spend a great deal of time performing graphics calculations. This could rob the computer system of the processing power needed for performing other tasks associated with program execution and thereby dramatically reduce overall system performance. However, with a powerful graphics system, the CPU may send a request to the graphics system stating: xe2x80x9cdraw a box at these coordinatesxe2x80x9d. The graphics system then draws the box, freeing the processor to perform other tasks.
Since graphics systems typically perform only a limited set of functions, they may be customized and therefore far more efficient at graphics operations than the computer""s general-purpose central processor. Graphics system processors are specialized for computing graphical transformations, so they tend to achieve better results than the general-purpose CPU used by the computer system. In addition, they free up the computer""s CPU to execute other commands while the graphics system is handling graphics computations. The popularity of graphical applications, and especially multimedia applications, has made high performance graphics systems a common feature of computer systems. Most computer manufacturers now bundle a high performance graphics system with their systems.
Early graphics systems were limited to performing two-dimensional (2D) graphics. Their functionality has since increased to support three-dimensional (3D) wire-frame graphics, 3D solids, and now includes support for three-dimensional (3D) graphics with textures and special effects such as advanced shading, fogging, alpha-blending, and specular highlighting.
While the number of pixels is an important factor in determining graphics system performance, another factor of equal import is the quality of the image. Various methods are used to improve the quality of images, such as anti-aliasing, alpha blending, and fogging. While various techniques may be used to improve the appearance of computer graphics images, they also have certain limitations. In particular, they may introduce their own image aberrations or artifacts, and are typically limited by the density of pixels displayed on the display device.
As a result, a graphics system is desired which is capable of utilizing increased performance levels to increase not only the number of pixels rendered, but also the quality of the image rendered. In addition, a graphics system is desired which is capable of utilizing increases in processing power to improve graphics effects.
Prior art graphics systems have generally fallen short of these goals. Prior art graphics systems use a conventional frame buffer for refreshing pixel/video data on the display. The frame buffer stores rows and columns of pixels that exactly correspond to respective row and column locations on the display. Prior art graphics systems render 2D and/or 3D images or objects into the frame buffer in pixel form, and then read the pixels from the frame buffer to refresh the display. To reduce visual artifacts that may be created by refreshing the screen at the same time as the frame buffer is being updated, most graphics systems"" frame buffers are double-buffered.
To obtain images that are more realistic, some prior art graphics systems have implemented super-sampling by generating more than one sample per pixel. By calculating more samples than pixels (i.e., super-sampling), a more detailed image is calculated than can be displayed on the display device. For example, a graphics system may calculate 4, 8 or 16 samples for each pixel to be output to the display device. After the samples are calculated, they are then combined, convolved, or filtered to form the pixels that are stored in the frame buffer and then conveyed to the display device. Using pixels formed in this manner may create a more realistic final image because overly abrupt changes in the image may be smoothed by the filtering process.
As used herein, the term xe2x80x9csamplexe2x80x9d refers to calculated information that indicates the color of the sample and possibly other information, such as depth (z), transparency, etc., of a particular point on an object or image. For example, a sample may comprise the following component values: a red value, a green value, a blue value, a z value, and an alpha value (e.g., representing the transparency of the sample). A sample may also comprise other information, e.g., a z-depth value, a blur value, an intensity value, brighter-than-bright information, and an indicator that the sample consists partially or completely of control information rather than color information (i.e., xe2x80x9csample control informationxe2x80x9d).
When a graphics system implements super-sampling, the graphics system is typically required to select sample positions for the samples, generate samples at the selected sample positions, read a plurality of samples, i.e., sample data, corresponding to the area or support region of a filter, and then filter the samples within the filter region to generate an output pixel. To generate pixel values from sample data in real time as needed for a video data stream, improved methods are desired for managing the sample data used to generate pixel values for each pixel location.
The problems set forth above may at least in part be solved by a data management system and method for real time calculation of pixel values from sample data. The elements of such a data management system may include a sample buffer that is configured to store sample data in rows of sample bins. Sample data for one or more sample positions may be stored in each sample bin and the rows of sample bins define a region in sample space. Sample data includes one or more of sample location, color values, transparency value, and depth. A bin scanline cache may be configured to store P rows of sample bins copied from P sequential rows of the sample buffer from a specified portion of sample space. N sequential rows of the P rows may be approximately vertically centered on a selected pixel location in sample space. N and P are positive integers, and P is greater than or equal to N. A sample cache may be configured to store an Nxc3x97N sample bin array of sample bins copied from N sequential columns of the N sequential rows of the bin scanline cache. The sample bins contained in the Nxc3x97N sample bin array may be approximately centered on the selected pixel location in sample space.
A sample processor may be configured to determine pixel values for the selected pixel location by processing one or more sample values stored in the sample cache. A sample controller may be configured to select a sequence of pixel locations in sample space that corresponds to a sequence of pixels in a video data stream. The sample controller may execute, for each pixel location in the sequence, a set of operations that includes one or more of: a) reading sample data from one or more sequentially selected rows of sample bins from the sample buffer and storing said sample data in one or more corresponding rows of sample bins in the bin scanline cache, b) reading sample data from one or more sequentially selected columns of N sample bins from the bin scanline cache and storing said sample data in one or more corresponding columns of N sample bins in the sample cache, so that for each pixel in the sequence, the Nxc3x97N sample bin array is an array of sample bins that are approximately centered on the sample bin that contains the pixel location, c) initiating the determination of pixel values by the sample processor for the pixel location by processing the sample data stored in the sample bins of the Nxc3x97N sample bin array, and d) outputting pixel data for inclusion in the video data stream. In some embodiments, the video data stream may be a real time video stream.
The system may also include a filter weights cache for storing filter coefficients that may be used to compute a weighted average of the sample data in the sample bins of the Nxc3x97N sample bin array stored in the sample cache.
The system may also include a host computer configured to provide a stream of polygons representative of a collection of objects, a graphics processor (e.g. a rendering engine) for rendering the polygons into sample data and storing the sample data in the sample buffer, a video output unit configured to receive pixel values, convert the pixel values into a video signal, and output the video signal to a display.
In some embodiments, the method includes determining pixel values by calculating a weighted sum of the sample values for one or more sample locations from each of the sample bins in the Nxc3x97N sample bin array using weight coefficients corresponding to a specified filter function with a specified filter extent. In these embodiments, the weight coefficients for each sample location may be determined by using a lookup table of values, stored in a filter weights cache corresponding to a specified filter function. The specified filter function may be programmable, and may be selected from a set of filter functions including, but not limited to, box filters, tent filters, square filters, and radial filters.